package org.wattdepot.cli.command;

import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.wattdepot.cli.CommandLineInterface;

/**
 * Test that checks for valid output within the ListSources class.
 * 
 * @author Anthony Xu & John Mack
 * 
 */
public class TestListSources {
  /**
   * Test to see if ListSources class displays correct output sources.
   * 
   * @throws Exception NotAuthorizedException, ResourceNotFoundException, BadXmlException,
   * MiscClientException.
   */
  @Test
  public void testingSources() throws Exception {
    CommandLineInterface cli = new CommandLineInterface();
    List<String> commands = new ArrayList<String>();
    commands.add("sources");

    String theSources = new ListSources().doCommand(cli, commands);
    assertEquals("correct fuel output", "All public sources:" + "\n" +
"SIM_AES" + "\n" +
"SIM_HONOLULU" + "\n" +
"SIM_HONOLULU_8" + "\n" +
"SIM_HONOLULU_9" + "\n" +
"SIM_HPOWER" + "\n" +
"SIM_IPP" + "\n" +
"SIM_KAHE" + "\n" +
"SIM_KAHE_1" + "\n" +
"SIM_KAHE_2" + "\n" +
"SIM_KAHE_3" + "\n" +
"SIM_KAHE_4" + "\n" +
"SIM_KAHE_5" + "\n" +
"SIM_KAHE_6" + "\n" +
"SIM_KAHE_7" + "\n" +
"SIM_KALAELOA" + "\n" +
"SIM_OAHU_GRID" + "\n" +
"SIM_WAIAU" + "\n" +
"SIM_WAIAU_10" + "\n" +
"SIM_WAIAU_5" + "\n" +
"SIM_WAIAU_6" + "\n" +
"SIM_WAIAU_7" + "\n" +
"SIM_WAIAU_8" + "\n" +
"SIM_WAIAU_9" + "\n", theSources);
  }

}
